<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/1
 * Time: 22:03
 */

namespace Lib\Api;


class OrganizationBelongApi extends UtilsApi {
    private static $modelName = 'OrganizationBelong';

    /** 获取机构列表
     * @param $where
     * @return mixed
     */
    public static function getAllList($where) {
        $model = M('OrganizationBelong');
        $data = $model->where($where)->select();
        return $data;
    }

    /** 批量添加数据
     * @param $data
     * @return mixed
     */
    public static function addAll($data) {
        $model = M(OrganizationBelongApi::$modelName);
        return $model->addAll($data);
    }

    public static function getAllByCondition($where, $left,  $field = "*") {
        $model = M();
        $list = $model->table('fs_organization_belong a')
            ->join($left)
            ->field($field)
            ->where($where)
            ->select();
        return $list;
    }
}